var mongoose =require('mongoose');
mongoose.connect('mongodb://localhost/job');
var schema = mongoose.Schema;
var chatSchema = new schema({
    chatid:{
        type:String,
        required:true
    },
    from:{
        type:String,
        required:true
    },
    to:{
        type:String,
        required:true
    },
    read:{
        type:Boolean,
        default:false
    },
    content:{
        type:String,
        required:true
    },
    create_time:{
        type:String,
        default:new Date().getTime()
    },

})

var chat = mongoose.model('chat',chatSchema);
module.exports = chat;